<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Configure Scripting</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Bochs Developers Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="About the code"
HREF="about-the-code.html"><LINK
REL="PREVIOUS"
TITLE="Emulator Objects"
HREF="emulator-objects.html"><LINK
REL="NEXT"
TITLE="Log Functions"
HREF="logfunctions.html"></HEAD
><BODY
CLASS="SECTION"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Bochs Developers Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="emulator-objects.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 2. About the code</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="logfunctions.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECTION"
><H1
CLASS="SECTION"
><A
NAME="CONFIGURE-SCRIPTING"
>2.4. Configure Scripting</A
></H1
><P
>Like many other open source projects, Bochs uses a configure script created with
<B
CLASS="COMMAND"
>autoconf</B
>. The configure script generates all makefiles and a
set of header and support files from templates.</P
><P
>This example shows how to add an option to the template file <TT
CLASS="FILENAME"
>configure.in</TT
>.
The resulting configure script sets up symbols like <CODE
CLASS="OPTION"
>BX_SUPPORT_BUSMOUSE</CODE
>
in the output file <TT
CLASS="FILENAME"
>config.h</TT
> and replaces <CODE
CLASS="OPTION"
>@BUSM_OBJS@</CODE
>
entries in the makefile output.
<PRE
CLASS="SCREEN"
>BUSM_OBJS=''
AC_MSG_CHECKING(for Busmouse support)
AC_ARG_ENABLE(busmouse,
  AS_HELP_STRING([--enable-busmouse], [enable Busmouse support (InPort)]),
  [if test "$enableval" = yes; then
    AC_MSG_RESULT(yes)
    AC_DEFINE(BX_SUPPORT_BUSMOUSE, 1)
    BUSM_OBJS='busmouse.o'
   else
    AC_MSG_RESULT(no)
    AC_DEFINE(BX_SUPPORT_BUSMOUSE, 0)
   fi],
  [
    AC_DEFINE(BX_SUPPORT_BUSMOUSE, 0)
    AC_MSG_RESULT(no)]
  )
AC_SUBST(BUSM_OBJS)</PRE
></P
><P
>These output files are generated by the configure script in addition to the makefiles.
<P
></P
><UL
><LI
><P
><TT
CLASS="FILENAME"
>config.h</TT
> - the main header file</P
></LI
><LI
><P
><TT
CLASS="FILENAME"
>ltdlconf.h</TT
> - header file required for compiling with libtool</P
></LI
><LI
><P
><TT
CLASS="FILENAME"
>bxversion.h</TT
> - header file containing version strings</P
></LI
><LI
><P
><TT
CLASS="FILENAME"
>bxversion.rc</TT
> - resource file for Windows with version information</P
></LI
><LI
><P
><TT
CLASS="FILENAME"
>build/linux/bochs-dlx</TT
> - DLX Linux shortcut script (Linux only)</P
></LI
><LI
><P
><TT
CLASS="FILENAME"
>build/macosx/Info.plist</TT
> - property list file for MacOSX</P
></LI
><LI
><P
><TT
CLASS="FILENAME"
>build/win32/nsis/bochs.nsi</TT
> - NSIS script for creating Windows installer package</P
></LI
></UL
></P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="emulator-objects.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="logfunctions.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Emulator Objects</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="about-the-code.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Log Functions</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>